/* 
 * File:   graph.h
 * Author: kenji
 *
 * Created on December 17, 2013, 8:45 AM
 */

#ifndef GRAPH_H
#define	GRAPH_H


#define RAD 6371
#define TO_RAD (3.1415926536 / 180)

#include "vertex.h"
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
 
#define GNode std::pair< int,int> 

class Graph
{
public:
    Graph();

    ~Graph();

    Vertex* find(int id);

    void addVertex(int id, double lat, double lon);

    bool addEdge(int from, int to);

    void print()const;

    int size()const;

    std::vector<GNode> * getAdjacencyMatrix();

    int* getVertexId();

private:

    Vertex* findVertex(Vertex*, int);

    int haversineFormula(double lat1, double lon1, double lat2, double lon2);

    Vertex *first_;

    int* vertexId_;

};


#endif	/* GRAPH_H */
